package ma.ensao.egicom.core.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.scub.foundation.framework.core.model.BaseModel;

@Entity
@Table(name = "supplier", schema = "public")
public class Supplier extends BaseModel {

    private String firstname;

    private String lastname;

    private String email;

    private String password;

    private String adr;

    private String city;

    private String accountnumber;

    @OneToMany(fetch = FetchType.EAGER)
    @JoinColumn(name = "supplierid", referencedColumnName = "ID")
    private Set<Product> products = new HashSet<Product>(0);

    public Supplier() {
    }

    @Column(name = "firstname", length = 25)
    public String getFirstname() {
        return this.firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    @Column(name = "lastname", length = 25)
    public String getLastname() {
        return this.lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    @Column(name = "email", length = 25)
    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Column(name = "password", length = 25)
    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name = "adr", length = 25)
    public String getAdr() {
        return this.adr;
    }

    public void setAdr(String adr) {
        this.adr = adr;
    }

    @Column(name = "city", length = 25)
    public String getCity() {
        return this.city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    @Column(name = "accountnumber", length = 25)
    public String getAccountnumber() {
        return this.accountnumber;
    }

    public void setAccountnumber(String accountnumber) {
        this.accountnumber = accountnumber;
    }

    public Set<Product> getProducts() {
        return this.products;
    }

    public void setProducts(Set<Product> products) {
        this.products = products;
    }

    @Override
    public boolean equals(Object other) {
        // TODO Auto-generated method stub
        return false;
    }

}
